<template>
	<div v-if="orderList.length > 0">
		<p>额度订单</p>
		<el-table :data="orderList" border>
			<el-table-column
				type="index"
				label="序号"
				align="center"
				width="50" />
			<el-table-column
				align="center"
				prop="orderCode"
				label="订单编号"
				min-width="120">
				<template v-slot="{ row }">
					<e-button
						size="mini"
						type="text"
						@click="goQurtaDetail(row)">
						{{ row.orderCode }}
					</e-button>
				</template>
			</el-table-column>
			<el-table-column
				align="center"
				prop="createTime"
				label="创建时间"
				min-width="120" />
		</el-table>
	</div>
</template>

<script>
	import { quotaOrderMap } from '@/api/letterReview/letterReview';

	export default {
		name: 'orderTable',
		props: {
			orderNo: {
				type: String,
				default: '',
			},
		},
		computed: {},
		watch: {},
		data() {
			return {
				orderList: [],
			};
		},
		created() {
			if (this.orderNo) {
				this.handleList(this.orderNo);
			}
		},
		mounted() {},
		methods: {
			goQurtaDetail(row) {
				// if (this.checkPermi(['quota:apply:list:look'])) {
				this._toPage({
					path: '/vehicleOrder/orderManagement/OrderDetails',
					name: 'OrderDetails',
					query: {
						type: row.carType,
						orderId: row.orderId,
						calcSchemeId: row.calcSchemeId,
					},
				});
				// } else {
				//   this.$message.warning('无权限')
				// }
			},

			handleList(val) {
				quotaOrderMap(val).then(res => {
					this.orderList = res.data || [];
				});
			},
		},
	};
</script>

<style scoped lang="scss">
	::v-deep .el-button--text {
		user-select: auto;
	}
</style>
